| Total Complexity | 3 |
| Total Lines | 17 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | import { wrapIn } from 'prosemirror-commands'; |
||
| 6 | export default class BlockquoteMenuItemDispatcher extends AbstractMenuItemDispatcher { |
||
| 7 | static isAvailable(schema) { |
||
| 8 | return !!schema.nodes.blockquote; |
||
| 9 | } |
||
| 10 | |||
| 11 | static getMenuItem(schema) { |
||
| 12 | if (!this.isAvailable(schema)) { |
||
| 13 | console.log(schema); |
||
|
|
|||
| 14 | throw new Error('Blockquote is not available in schema!'); |
||
| 15 | } |
||
| 16 | return new MenuItem({ |
||
| 17 | command: wrapIn(schema.nodes.blockquote), |
||
| 18 | icon: svgIcon('format-quote-close'), |
||
| 19 | label: LANG.plugins.prosemirror['label:blockquote'], |
||
| 20 | }); |
||
| 21 | } |
||
| 22 | } |
||
| 23 |